<?php

namespace App\Providers;

use App\Good;
use App\OrderPay;
use App\Policies\GoodsPolicy;
use App\Policies\OrderPayPolicy;
use App\Policies\UserPolicy;
use App\User;
use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;

class AuthServiceProvider extends ServiceProvider
{
    /**
     * The policy mappings for the application.
     *
     * @var array
     */
    protected $policies = [
        OrderPay::class=>OrderPayPolicy::class,
        Good::class=>GoodsPolicy::class,
        User::class=>UserPolicy::class

    ];

    /**
     * Register any authentication / authorization services.
     *
     * @return void
     */
    public function boot()
    {
        $this->registerPolicies();
        //用户是否有权限查看
        Gate::define('viewTeam', 'App\Policies\MyTeamPolicy@viewTeam');
        //
    }
}
